package com.bwie.user.controller;

import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import com.bwie.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    /**
     * 根据用户名称查询用户信息
     * @param userName
     * @return
     */
    @PostMapping("/findName/{userName}")
    public Result findName(@PathVariable String userName){
        User user = userService.findName(userName);
        return Result.success(user);
    }
}
